-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore ES indexes without mappings #4535
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but I would prefer to wait for Martin as I am not too familiar with ES connector.
presto-elasticsearch/src/main/java/io/prestosql/elasticsearch/ElasticsearchMetadata.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(skimming)
presto-elasticsearch/src/main/java/io/prestosql/elasticsearch/client/ElasticsearchClient.java
Outdated
Show resolved
Hide resolved
private void createIndex(String indexName) | ||
throws IOException | ||
{ | ||
client.getLowLevelClient().performRequest("PUT", "/" + indexName, ImmutableMap.of()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it equiv to createIndex(indexName, '{}')
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, ElasticsearchClient
expects at least one property to be present when processing mappings.
Empty indexes can cause exceptions when trying to query the corresponding table or the information schema (e.g. the
columns
table).